#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cout << "Enter the size of array";
    cin >> n;
    int a[n];
    cout << "Enter array elements";

    for(int i=1; i<=n; ++i){
        cin >> a[i];
    }

  
    int lk;
    while(1){ 
          cout << "Enter 11 to  add() element Enter 12 to pop() an element Press 0 to exit";
        cin >> lk;
        if(lk == 11){
            int nt;
            cout << "Enter ele to add";
            cin >> nt;
            a[n+1]=nt;
            n++;
            }

        if(lk == 12){
            for(int i=1 ; i <=n ; ++i){
                a[i]=a[i+1];
            }
            n--;
        }

        if(lk == 0){
            for(int i=1 ;i<=n ; ++i){
                cout << a[i] << " ";
            }
            break;
        }
        
    }

}
/* 
************************* output *******************************
Enter the size of array 4
Enter array elements 1 5 4 3
Enter 11 to  add() element Enter 12 to pop() an element Press 0 to exit 11
Enter ele to add 55
Enter 11 to  add() element Enter 12 to pop() an element Press 0 to exit0
1 5 4 3 55 

Enter the size of array 4
Enter array elements 1 2 5 3
Enter 11 to  add() element Enter 12 to pop() an element Press 0 to exit 12
Enter 11 to  add() element Enter 12 to pop() an element Press 0 to exit.
2 5 3 

*/
